﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YouDaoNotesCodes.Url
{
    //url编码和解码
    class UrlEncode_Decode
    {

        public void EncodeandDecode()
        {
            string url = "https://blog.csdn.net/duling509/article/details/7169485";
            string urlEncode = System.Web.HttpUtility.UrlEncode(url);//url编码
            string urlDecode = System.Web.HttpUtility.UrlDecode(urlEncode);//url解码
            Console.WriteLine(@"url编码：" + urlEncode
                             + "url解码：" + urlDecode);
        }
    }
}
